﻿package com.mixmedia.locale {
	import flash.events.Event;
	import flash.events.EventDispatcher;	

	/**
	 * @author colin
	 */
	final public class Language extends EventDispatcher {
		static private var ins:Language;
		static public function instance():Language{
			if(ins==null)ins = new Language();
			return ins;
		}
	
		public static var LANG_EN:Array = ["en","eng"];
		public static var LANG_CN:Array = ["zh-CN","schi"];
		
		private var currentLang:Array = LANG_EN;
		
		private function Language() {}
		
		public function set lang(strLang:Array):void{
			currentLang = strLang[0];
			var evt:Event = new Event(Event.CHANGE);
			evt.target = this;
			dispatchEvent(evt);
		}
	
		public function get lang():String{
			return currentLang[0];
		}
		
		public function get id():String{
			return currentLang[1];
		}
	}

}